<template>
  <div class="container_cooperate__header1">
    <div class="container_cooperate__header1__top">
      <div class="container_cooperate__header1__top__left">
        <img
          v-if="userInfo?.username"
          :src="userInfo?.headImg"
          class="container_cooperate__header1__top__left__img"
          alt=""
        />
        <img
          src="../../../image/defaultHeadImg.png"
          alt=""
          style="width: 50rem; height: 50rem; color: #fff"
          v-else
        />
      </div>
      <div
        class="container_cooperate__header1__top__mid"
        v-show="userInfo?.username"
      >
        <div class="container_cooperate__header1__top__mid__top">
          <div class="container_cooperate__header1__top__mid__top__name">
            {{ userInfo?.username }}的工作室
          </div>
          <div class="container_cooperate__header1__top__mid__top__tag">
            {{ userInfo?.hospitaltype }}
          </div>
        </div>
        <div class="container_cooperate__header1__top__mid__bottom">
          <div class="container_cooperate__header1__top__mid__bottom__name">
            {{ userInfo?.hospital }}
          </div>
          <div class="container_cooperate__header1__top__mid__bottom__type">
            {{ userInfo?.section_office }}
          </div>
        </div>
      </div>
      <div
        class="container_cooperate__header1__top__right iconfont"
        @click="isShowCode"
      >
        &#xe680;
      </div>
    </div>
    <div class="container_cooperate__header1__bottom">
      擅长：{{ userInfo?.describe }}
    </div>
  </div>
  <ShowCode
    v-if="showCode && userInfo?.username"
    :showCode="showCode"
    @change-code="changeCode"
  />
</template>
<script setup>
import storage from "../../../utils/storage";
import ShowCode from "../../showCode/ShowCode.vue";
import toShowCode from "../../effects/showCode";
import { reactive } from "vue";
const { showCode, isShowCode, changeCode } = toShowCode;

let userInfo = reactive({});
userInfo = storage.getItem("userInfo");
</script>
<style lang="scss" scoped>
.container_cooperate__header1 {
  width: 414rem;
  height: 183rem;
  background-color: #6481da;
  padding-top: 50rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  color: #fff;
  font-size: 13rem;
  &__top {
    display: flex;
    justify-content: space-around;
    align-items: center;
    &__left {
      &__img {
        width: 59rem;
        height: 59rem;
        border-radius: 50%;
      }
    }
    &__mid {
      margin-left: -50rem;
      &__top {
        display: flex;
        margin-bottom: 10rem;
        &__name {
          font-size: 16rem;
          font-weight: bold;
          margin-right: 15rem;
          width: 100rem;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }
        &__tag {
          width: 59rem;
          height: 20rem;
          text-align: center;
          line-height: 20rem;
          font-size: 11rem;
          background-color: #f77a08;
          padding: 1rem;
        }
      }
      &__bottom {
        display: flex;
        &__name {
          margin-right: 10rem;
        }
      }
    }
    &__right {
      font-size: 48rem;
      font-weight: normal;
    }
  }
  &__bottom {
    padding: 0 28rem;
  }
}
</style>
